home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume3 / xfig / patch6 next >
Encoding:
Text File  |  1989-02-16  |  9.3 KB  |  356 lines

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v03i013:  a MacDraw like graphics editor, Patch6
  5. Message-ID: <2062@wyse.wyse.com>
  6. Date: 16 Feb 89 22:17:11 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 345
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: dana@thumper.bellcore.com (Dana A. Chee)
  12. Posting-number: Volume 3, Issue 13
  13. Archive-name: xfig/patch6
  14.  
  15.  
  16.  
  17. Third patch for the R3 distribution of xfig
  18.  
  19. Dana Chee, Bellcore, dana@thumper.bellcore.com
  20.  
  21.     * This is patchlevel 6
  22.     * main.c - added settable fonts for text (-normalFont, xfig*normalFont)
  23.       and (-boldFont, xfig*boldFont)
  24.     * font.c - added settable fonts for text
  25.     * popup.c - made menus handle changed fonts correctly
  26.     * panel.c - fixed problem with *BorderWidth causing icons to
  27.       display incorrectly (single line).
  28.     * xfig.1 - added info on font arguments.
  29.  
  30. *** /tmp/d13364    Wed Feb  8 11:21:08 1989
  31. --- patchlevel.h    Wed Feb  8 10:41:11 1989
  32. ***************
  33. *** 1
  34. ! #define PATCHLEVEL 5
  35.  
  36. --- 1 -----
  37. ! #define PATCHLEVEL 6
  38. *** /tmp/d13368    Wed Feb  8 11:21:09 1989
  39. --- main.c    Wed Feb  8 11:01:03 1989
  40. ***************
  41. *** 29,34
  42.   #ifdef    X11
  43.   #include "fig.icon.X"
  44.   Pixmap    fig_icon;
  45.   #else
  46.   #include "fig.icon"
  47.   #define         FIG_ICON_WIDTH        MY_ICON_WIDTH
  48.  
  49. --- 29,36 -----
  50.   #ifdef    X11
  51.   #include "fig.icon.X"
  52.   Pixmap    fig_icon;
  53. + extern char    *boldFont;
  54. + extern char    *normalFont;
  55.   #else
  56.   #include "fig.icon"
  57.   #define         FIG_ICON_WIDTH        MY_ICON_WIDTH
  58. ***************
  59. *** 199,204
  60.            (Cardinal)&TRACKING, XtRBoolean, (caddr_t)&true},
  61.       {"inches", "Inches", XtRBoolean, sizeof(int),
  62.            (Cardinal)&INCHES, XtRBoolean, (caddr_t)&true},
  63.   };
  64.   
  65.   static XrmOptionDescRec options[] =
  66.  
  67. --- 201,210 -----
  68.            (Cardinal)&TRACKING, XtRBoolean, (caddr_t)&true},
  69.       {"inches", "Inches", XtRBoolean, sizeof(int),
  70.            (Cardinal)&INCHES, XtRBoolean, (caddr_t)&true},
  71. +     {"boldFont", "BoldFont", XtRString, sizeof(caddr_t),
  72. +          (Cardinal)&boldFont, XtRString, (caddr_t)NULL},
  73. +     {"normalFont", "NormalFont", XtRString, sizeof(caddr_t),
  74. +          (Cardinal)&normalFont, XtRString, (caddr_t)NULL},
  75.   };
  76.   
  77.   static XrmOptionDescRec options[] =
  78. ***************
  79. *** 219,224
  80.       {"-imperial", ".inches", XrmoptionNoArg, "True"},
  81.       {"-centimeters", ".inches", XrmoptionNoArg, "False"},
  82.       {"-metric", ".inches", XrmoptionNoArg, "False"},
  83.   };
  84.   
  85.   static XtCallbackRec    callbacks[] =
  86.  
  87. --- 225,232 -----
  88.       {"-imperial", ".inches", XrmoptionNoArg, "True"},
  89.       {"-centimeters", ".inches", XrmoptionNoArg, "False"},
  90.       {"-metric", ".inches", XrmoptionNoArg, "False"},
  91. +     {"-boldFont", ".boldFont", XrmoptionSepArg, 0},
  92. +     {"-normalFont", ".normalFont", XrmoptionSepArg, 0},
  93.   };
  94.   
  95.   static XtCallbackRec    callbacks[] =
  96. *** /tmp/d13371    Wed Feb  8 11:21:10 1989
  97. --- popup.c    Wed Feb  8 10:34:54 1989
  98. ***************
  99. *** 90,96
  100.   int init_menu(tool)
  101.       TOOL            tool;
  102.   {
  103. !     TOOL            panes, pane;
  104.       register int        i, tlen, rlen = 0;
  105.       register MENUITEM    *mi;
  106.       XtTranslations        popdown_actions, pane_actions;
  107.  
  108. --- 90,96 -----
  109.   int init_menu(tool)
  110.       TOOL            tool;
  111.   {
  112. !     TOOL            panes, pane, title;
  113.       register int        i, tlen, rlen = 0;
  114.       register MENUITEM    *mi;
  115.       XtTranslations        popdown_actions, pane_actions;
  116. ***************
  117. *** 94,100
  118.       register int        i, tlen, rlen = 0;
  119.       register MENUITEM    *mi;
  120.       XtTranslations        popdown_actions, pane_actions;
  121.       menu = XtCreatePopupShell("popup_menu", overrideShellWidgetClass, tool,
  122.           menu_args, XtNumber(menu_args));
  123.       popdown_actions = XtParseTranslationTable(
  124.  
  125. --- 94,102 -----
  126.       register int        i, tlen, rlen = 0;
  127.       register MENUITEM    *mi;
  128.       XtTranslations        popdown_actions, pane_actions;
  129. !     Arg            my_list;
  130. !     PIX_FONT        temp_font;
  131. !     
  132.       menu = XtCreatePopupShell("popup_menu", overrideShellWidgetClass, tool,
  133.           menu_args, XtNumber(menu_args));
  134.       popdown_actions = XtParseTranslationTable(
  135. ***************
  136. *** 114,121
  137.               rlen = tlen;
  138.       }
  139.       
  140. -     pane_args[3].value = char_width(canvas_font) * rlen + 10;
  141.       pane_args[2].value = (XtArgVal)"COMMANDS";
  142.       pane = XtCreateManagedWidget("title", labelWidgetClass,
  143.                      panes, pane_args, 4);
  144.  
  145. --- 116,121 -----
  146.               rlen = tlen;
  147.       }
  148.       
  149.       pane_args[2].value = (XtArgVal)"COMMANDS";
  150.       title = XtCreateManagedWidget("title", labelWidgetClass,
  151.                      panes, pane_args, 4);
  152. ***************
  153. *** 117,123
  154.       pane_args[3].value = char_width(canvas_font) * rlen + 10;
  155.   
  156.       pane_args[2].value = (XtArgVal)"COMMANDS";
  157. !     pane = XtCreateManagedWidget("title", labelWidgetClass,
  158.                      panes, pane_args, 4);
  159.       for (i = 0; i < XtNumber(pumenu_items); ++i)
  160.       {
  161.  
  162. --- 117,123 -----
  163.       }
  164.       
  165.       pane_args[2].value = (XtArgVal)"COMMANDS";
  166. !     title = XtCreateManagedWidget("title", labelWidgetClass,
  167.                      panes, pane_args, 4);
  168.   
  169.       /* create the first pane */
  170. ***************
  171. *** 119,125
  172.       pane_args[2].value = (XtArgVal)"COMMANDS";
  173.       pane = XtCreateManagedWidget("title", labelWidgetClass,
  174.                      panes, pane_args, 4);
  175. !     for (i = 0; i < XtNumber(pumenu_items); ++i)
  176.       {
  177.           mi = &pumenu_items[i];
  178.           pane_args[2].value = (XtArgVal)mi->label;
  179.  
  180. --- 119,144 -----
  181.       pane_args[2].value = (XtArgVal)"COMMANDS";
  182.       title = XtCreateManagedWidget("title", labelWidgetClass,
  183.                      panes, pane_args, 4);
  184. !     /* create the first pane */
  185. !     mi = &pumenu_items[0];
  186. !     pane_args[2].value = (XtArgVal)mi->label;
  187. !     pane_callbacks[0].closure = (caddr_t)mi;
  188. !     pane = XtCreateManagedWidget("pane", commandWidgetClass,
  189. !                      panes, pane_args, XtNumber(pane_args));
  190. !     XtOverrideTranslations(pane, pane_actions);
  191. !     /* get the default font */
  192. !     my_list.value = (XtArgVal)&temp_font;
  193. !     my_list.name = XtNfont;
  194. !     XtGetValues(pane, &my_list, 1);
  195. !     /* set the width of this pane and the title to the correct width */
  196. !     pane_args[3].value = char_width(temp_font) * rlen + 10;
  197. !     XtSetValues(title, &pane_args[3], 1);
  198. !     XtSetValues(pane, &pane_args[3], 1);
  199. !     
  200. !     for (i = 1; i < XtNumber(pumenu_items); ++i)
  201.       {
  202.           mi = &pumenu_items[i];
  203.           pane_args[2].value = (XtArgVal)mi->label;
  204. *** /tmp/d13375    Wed Feb  8 11:21:11 1989
  205. --- font.c    Wed Feb  8 10:13:22 1989
  206. ***************
  207. *** 25,30
  208.       canvas_font = roman_font;
  209.       }
  210.   #else
  211.   init_font()
  212.   {
  213.       canvas_font = roman_font = XLoadQueryFont(tool_d, NORMAL_FONT);
  214.  
  215. --- 25,32 -----
  216.       canvas_font = roman_font;
  217.       }
  218.   #else
  219. + char    *boldFont = NULL;
  220. + char    *normalFont = NULL;
  221.   init_font()
  222.   {
  223.       if( boldFont == NULL || *boldFont == NULL)
  224. ***************
  225. *** 27,33
  226.   #else
  227.   init_font()
  228.   {
  229. !     canvas_font = roman_font = XLoadQueryFont(tool_d, NORMAL_FONT);
  230. !     bold_font = XLoadQueryFont(tool_d, BOLD_FONT);
  231.   }
  232.   #endif    X11
  233.  
  234. --- 29,40 -----
  235.   char    *normalFont = NULL;
  236.   init_font()
  237.   {
  238. !     if( boldFont == NULL || *boldFont == NULL)
  239. !         boldFont = BOLD_FONT;
  240. !     if( normalFont == NULL || *normalFont == NULL)
  241. !         normalFont = NORMAL_FONT;
  242. !     
  243. !     canvas_font = roman_font = XLoadQueryFont(tool_d, normalFont);
  244. !     bold_font = XLoadQueryFont(tool_d, boldFont);
  245.   }
  246.   #endif    X11
  247. *** /tmp/d13379    Wed Feb  8 11:21:12 1989
  248. --- panel.c    Wed Feb  8 10:53:01 1989
  249. ***************
  250. *** 159,164
  251.       { XtNbackgroundPixmap, (XtArgVal)NULL },
  252.       { XtNcallback, (XtArgVal)button_callbacks },
  253.       { XtNresizable, (XtArgVal) FALSE },
  254.   };
  255.   
  256.   extern int    PANEL_LEFT, PANEL_TOP, PANEL_HEIGHT, PANEL_WID;
  257.  
  258. --- 159,165 -----
  259.       { XtNbackgroundPixmap, (XtArgVal)NULL },
  260.       { XtNcallback, (XtArgVal)button_callbacks },
  261.       { XtNresizable, (XtArgVal) FALSE },
  262. +     { XtNborderWidth, (XtArgVal) 1},
  263.   };
  264.   
  265.   extern int    PANEL_LEFT, PANEL_TOP, PANEL_HEIGHT, PANEL_WID;
  266. *** /tmp/d13382    Wed Feb  8 11:21:14 1989
  267. --- xfig.1    Wed Feb  8 11:17:57 1989
  268. ***************
  269. *** 9,15
  270.   [ \fB-P[ortrait]\fP ]
  271.   [ \fB-w[idth]\fP \fIunits\fP ]
  272.   [ \fB-h[eight]\fP \fIunits\fP ]
  273. ! [ \fB-no[track]\fP ]
  274.   [ \fB-tr[ack]\fP ]
  275.   [ \fB-inc[hes]\fP ]
  276.   [ \fB-me[tric]\fP ]
  277.  
  278. --- 9,15 -----
  279.   [ \fB-P[ortrait]\fP ]
  280.   [ \fB-w[idth]\fP \fIunits\fP ]
  281.   [ \fB-h[eight]\fP \fIunits\fP ]
  282. ! [ \fB-not[rack]\fP ]
  283.   [ \fB-tr[ack]\fP ]
  284.   [ \fB-inc[hes]\fP ]
  285.   [ \fB-me[tric]\fP ]
  286. ***************
  287. *** 15,20
  288.   [ \fB-me[tric]\fP ]
  289.   [ \fB-inv[erse]\fP ]
  290.   [ \fB-de[bug]\fP ]
  291.   [ \fIfile\fP ]
  292.   .SH DESCRIPTION
  293.   .I Xfig 
  294.  
  295. --- 15,22 -----
  296.   [ \fB-me[tric]\fP ]
  297.   [ \fB-inv[erse]\fP ]
  298.   [ \fB-de[bug]\fP ]
  299. + [ \fB-normal[Font]\fP \fIfont\fP ]
  300. + [ \fB-bold[Font]\fP \fIfont\fP ]
  301.   [ \fIfile\fP ]
  302.   .SH DESCRIPTION
  303.   .I Xfig 
  304. ***************
  305. *** 111,116
  306.   .TP
  307.   \fB-de\fP
  308.   Turn on debugging mode.
  309.   .SH "GRAPHICAL OBJECTS"
  310.   The objects in \fIxfig\fP are divided into \fBprimitive objects\fP and
  311.   \fBcompound object\fP. The primitive objects are: \fIARC\fP, \fICIRCLE\fP,
  312.  
  313. --- 113,124 -----
  314.   .TP
  315.   \fB-de\fP
  316.   Turn on debugging mode.
  317. + .TP
  318. + \fB-normal\fP \fIfont\fP
  319. + Cause the font used for drawing on the canvas to be \fIfont\fP.
  320. + .TP
  321. + \fB-bold\fP \fIfont\fP
  322. + Cause the font used for displaying messages to be \fIfont\fP.
  323.   .SH "GRAPHICAL OBJECTS"
  324.   The objects in \fIxfig\fP are divided into \fBprimitive objects\fP and
  325.   \fBcompound object\fP. The primitive objects are: \fIARC\fP, \fICIRCLE\fP,
  326. ***************
  327. *** 420,425
  328.   .TP
  329.   debug
  330.   (boolean:off) -debug argument
  331.   .PP
  332.   These arguments correspond to the widgets which make up \fIxfig\fP.
  333.   .TP 1.5i
  334.  
  335. --- 428,439 -----
  336.   .TP
  337.   debug
  338.   (boolean:off) -debug argument
  339. + .TP
  340. + normalFont
  341. + (string:fixed) -normal argument
  342. + .TP
  343. + boldFont
  344. + (string:8x13bold) -bold argument
  345.   .PP
  346.   These arguments correspond to the widgets which make up \fIxfig\fP.
  347.   .TP 1.5i
  348. -- 
  349. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  350. Moderator of comp.sources.x
  351.